package command;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import domain.PersistentEntity;
import domain.User;

@Entity
@Table(name = "saved_search")
public class SearchForm extends PersistentEntity {
	@OneToOne(fetch=FetchType.EAGER)
	private User user;
	private String name;
	private String lastname;
	private String email;
	private String docnumber;
	private Date lastaccess;
	private Date birthdate;
	private String keywords;
	private String education;
	private String title;
	private String job;
	private String savedSearchName;
	private Boolean searchLinkedin;
	private Boolean searchFacebook;
	private Date date;
	
	public SearchForm() {
	}
	
	public SearchForm(User user) {
		this.setUser(user);
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}
	
	public void setDate(Date date) {
		this.date = date;
	}

	public Date getDate() {
		return date;
	}	
	
	public void setLastname(String lastname) {
		this.lastname = lastname;
	}

	public String getLastname() {
		return lastname;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getEmail() {
		return email;
	}

	public String getDocnumber() {
		return docnumber;
	}

	public Date getLastaccess() {
		return lastaccess;
	}

	public Date getBirthdate() {
		return birthdate;
	}

	public String getKeywords() {
		return keywords;
	}

	public String getEducation() {
		return education;
	}

	public String getTitle() {
		return title;
	}

	public String getJob() {
		return job;
	}

	public void setDocnumber(String docnumber) {
		this.docnumber = docnumber;
	}

	public void setLastaccess(Date lastaccess) {
		this.lastaccess = lastaccess;
	}

	public void setBirthdate(Date birthdate) {
		this.birthdate = birthdate;
	}

	public void setKeywords(String keywords) {
		this.keywords = keywords;
	}

	public void setEducation(String education) {
		this.education = education;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public void setJob(String job) {
		this.job = job;
	}

	public void setSavedSearchName(String savedSearchName) {
		this.savedSearchName = savedSearchName;
	}

	public String getSavedSearchName() {
		return savedSearchName;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public User getUser() {
		return user;
	}

	public void setSearchLinkedin(Boolean searchLinkedin) {
		this.searchLinkedin = searchLinkedin;
	}

	public Boolean getSearchLinkedin() {
		return searchLinkedin;
	}

	public boolean searchLinkedin() {
		return !(searchLinkedin == null || !searchLinkedin);
	}

	public void setSearchFacebook(Boolean searchFacebook) {
		this.searchFacebook = searchFacebook;
	}

	public Boolean getSearchFacebook() {
		return searchFacebook;
	}

	public boolean searchFacebook() {
		return !(searchFacebook == null || !searchFacebook);
	}
}

